
from base import StringBuffer
def render(score, name, size = 24):
    _ = StringBuffer()
    _('''
    <span class="starbarv3">
    <span class="stars">''')
    score = score * 10
    (star, r) = divmod(score, 20)
    star = int(star)
    r = int(r)
    _(('''<span class='star%d_full'></span>'''%size)*star)
    if r > 0:
        _('''<span class='star%d_half'></span>'''%size)
        r = 4 - star
    else:
        r = 5 - star
    _(('''<span class='star%d_empty'></span>'''%size)*r)
    _('''
    </span>
    </span>
    ''')
    return _.getvalue()